﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Lab_5._0
{
    public partial class Form1 : Form
    {
        int n = -1;
        int a = 3;
        int b = 106;
        int c = 0; 
        public Form1()
        {
            InitializeComponent();

        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
         
            if (textBox3.Text != "")
            {
                checkedListBox1.Items.Add(textBox3.Text, CheckState.Unchecked);
                checkedListBox2.Items.Add(textBox3.Text, CheckState.Unchecked);
                c = Convert.ToInt32(textBox4.Text);                
                a ++;
                b += c;
            }                      
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = a.ToString();
            textBox2.Text = b.ToString();
            textBox1.Visible = true;
            textBox2.Visible = true;            
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {
           
        }

        private void button3_Click_1(object sender, EventArgs e)
        {
            n = n * (-1);
            if (n == 1)
                checkedListBox2.Visible = true;
            else
                checkedListBox2.Visible = false;
        }

        private void checkedListBox2_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void label5_Click(object sender, EventArgs e)
        {

        }
    }
}
